#include <iostream>

template<typename T>
class Singleton
{
public:
    static T& getInstance()
    {
        static T instance;
        return instance;
    }
};

class Test : public Singleton<Test>
{
public:
    friend Singleton<Test>;
    void show()
    {
        std::cout<<"hello"<<"\n";
    }
private:
    Test(){}
};

int main()
{
    Test::getInstance().show();
    return 0;
}